package com.cat.at.chat.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.print.attribute.standard.PrinterURI;
import java.io.Serializable;
import java.util.List;
import java.util.stream.StreamSupport;

@Data
public class SparkRequestDTO implements Serializable {

    private Header header;
    private Parameter parameter;
    private Payload payload;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Header {
        @JSONField(name = "app_id")
        private String appId;
        @JSONField(name = "uid")
        private String uid;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Parameter {
        private Chat chat;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Chat {
        private String domain;
        private float temperature;
        @JSONField(name = "max_tokens")
        private int maxTokens;
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Payload {
        private Message message;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Message {
        private List<MessageText> text;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MessageText {
        private String role;
        private String content;
    }


}
